<!--
 * @Author: your name
 * @Date: 2021-04-20 15:12:59
 * @LastEditTime: 2021-04-21 15:46:59
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue03-demo\src\views\Home.vue
-->
<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    {{counter}}
    <hr />
    total-1: {{total}}
    total-2: {{total}}
    <button type="button" @click="add()">Add</button>
    <button type="button" @click="modify()">modify</button>
    <home-child :propsName="counter" @minus-event="minusEventHandler" id="5" />
    <hr />
    <ul>
      <li v-for="item in state.lists" :key="item.id">{{item.text}}</li>
    </ul>
    <button type="button" @click="setList">set index 0</button>
    <hr />
    <router-link to="/path" custom v-slot="{ navigate }">
      <span @click="navigate">Home</span>
    </router-link>
  </div>
</template>

<script lang="ts">
import HomeChild from './HomeChild.vue'
import { utils } from './home'
import router from '@/router'
export default {
  name: 'Home',
  components: {
    HomeChild
  },
  setup () {
    return {
      ...utils()
    }
  },
  mounted () {
    const result = router.resolve({
      name: 'notFound'
    }).href
    console.log('result :>> ', result)
  }
}
</script>
